<?php


class Form_Contact extends Zend_Form {

   public function __construct($options = null) {
      parent::__construct($options);
      
      $this->setName('contact');
      $fields = array(
         'name' => new Zend_Form_Element_Text('name', array('label' => 'Name', 'required' => true)),
         'email' => new Zend_Form_Element_Text('email', array('label' => 'Email', 'required' => true)),
         'message' => new Zend_Form_Element_Textarea('message', array('label' => 'Message', 'cols' => 20, 'rows' => 5)),
         'captcha' => new Zend_Form_Element_Captcha('captcha', array(
            'label' => "Verification",
            'captcha' => 'Image',
            'captchaOptions' => array(
               'wordLen' => 6,
               'timeout' => 300,
               'font' => './media/fonts/arial.ttf',
               'imgurl' => Zend_Controller_Front::getInstance()->getBaseUrl().'/images/captcha',
            ),
         )),
         'submit' => new Zend_Form_Element_Submit('login', array('label' => 'Send'))
      );
      
      /*$token = Zend_Controller_Front::getInstance()->getRequest()->getPost('password');      
      $fields['password2']->addValidator(new Zend_Validate_Identical(trim($token)))
                          ->addValidator(new Zend_Validate_StringLength(6, 30))
                          ->addFilter(new Zend_Filter_StringTrim())
                          ->isRequired();
                          
      $username = Zend_Controller_Front::getInstance()->getRequest()->getPost('username');
      $fields['username']->addValidator(new App_Validate_Unique('users', 'username'))
                         ->addValidator(new Zend_Validate_StringLength(6, 30))
                         ->addFilter(new Zend_Filter_StringTrim())                         
                         ->isRequired();
      */
      $this->addElements($fields);
      $this->setMethod('post');
      $this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl(). '/pages/contact');
      
   }



}